import React, { Component } from 'react'
import Infrom from './pages/home/entryPage'
import Search from './pages/searchPage/searchPage'
import Detail from './components/details/detailContainer/detailCon'
import SearchList from './pages/searchPage/searchListDetail'
import Transition from './pages/tarnsitionTest/index'
import Tesla from './components/Tesla/Tesla.jsx'
import Community from './components/communityList/communityDetail/comDetail'
import { Route, Redirect, Switch } from 'react-router-dom'

export default class App extends Component {
  render() {
    return (

      <Switch>
        <Route path="/index" component={Infrom}></Route>
        <Route path="/search" component={Search}></Route>
        <Route path="/detail/:id" component={Detail}></Route>
        <Route path="/result" component={SearchList}></Route>
        <Route path="/transition" component={Transition}></Route>
        <Route path="/tesla" component={Tesla}></Route>
        <Route path="/community" component={Community}></Route>
        <Redirect exact from="/" to="/index"></Redirect>
        <Route path="*" render={() => {
          return <h1>page not found 404 </h1>
        }}></Route>
      </Switch>
      
    )
  }
}
